<?php

namespace App\Http\Requests\Api;

class RefereeRequest extends FormRequest
{
    public function rules()
    {
        switch ($this->method()) {
            case 'POST':
                $arr = [
                    'name' => 'required|string',
                    'phone' => 'required|phone:CN,mobile',
                    'province' => 'required|string',
                    'city' => 'required|string',
                ];
                return $arr;
                break;
        }
    }

    public function attributes()
    {
        return [
            'name' => '姓名',
            'phone' => '手机号',
            'province' => '省份',
            'city' => '城市',
        ];
    }

    public function messages()
    {
        return [
            'phone.phone' => '手机号不存在',
        ];
    }
}
